{% extends "base.html" %}
{% load thumbnails %}

{% block title %}Bryan Saunders - {% if gallery_title %}{{ gallery_title }}{% else %}Comprehensive{% endif %} Gallery{% endblock %}

{% block content %}
{% if object_list %}
<table width="100%">
<!--<caption align="top">Click on an image or its title for detail view</caption>-->
{% for object in object_list %}
{% if forloop.counter|add:2|divisibleby:3 %}<tr>{% endif %}
    <!-- IMAGE {{ forloop.counter }} -->
    <td height="250" width="33%">
	<p align="center">
		<a href="{% url artwerx.views.artwork_single slug=object.slug %}">
			{% with object.image_file|thumbnail:"128x200" as image_thumb %}
			{% if image_thumb %}
			<img alt="{{ object.title }}" src="{{ image_thumb.url }}" height="{{ image_thumb.thumbnail.size.1 }}" width="{{ image_thumb.thumbnail.size.0 }}" /><br />
			{% else %}
			<img alt="{{ object.title }}" src="http://media.bryanlewissaunders.org/{{ object.image_file }}"  width="{{ object.get_image_file_width }}" height="{{ object.get_image_file_height }}" /><br />
			{% endif %}
			{% endwith %}
			</a>
			<a href="{% url artwerx.views.artwork_single slug=object.slug %}">{{ object.title }}</a><br />
		{% include "artwerx/info.html" %}
	</p>
    </td>
{% if forloop.counter|divisibleby:3 %}</tr>
	{% else %}{% if forloop.last %}</tr>{% endif %}
{% endif %}
{% endfor %}
</table>
{% else %}
	<p align="center">This gallery is empty.</p>
{% endif %}
<br />
<p align="center"><a href="{% url index %}">Home</a></p>
{% endblock %}
